export const throttle = (fn, t = 200) => {
    let last
    let timer
    return function() {
        const args = arguments
        const now = +new Date()
        if (last && now - last < t) {
            clearTimeout(timer)
            timer = setTimeout(() => {
                last = now
                fn.apply(this, args)
            }, t)
        } else {
            last = now
            fn.apply(this, args)
        }
    }
}